import {init} from 'snabbdom/build/package/init'
import {h} from 'snabbdom/build/package/h'
import {thunk} from 'snabbdom/build/package/thunk'
import {styleModule} from 'snabbdom/build/package/modules/style'
import {eventListenersModule} from 'snabbdom/build/package/modules/eventlisteners'

console.log(h,thunk,init)

let patch = init([
    styleModule,
    eventListenersModule
])

let vnode = h('div#containter',{
    style:{
        backgroundColor:'red'
    },
    on:{
        click:eventHandler
    }
},[
    h('h1','Hello Snabbdom'),
    h('p','P标签'),
])

function eventHandler (){
    console.log('惦记我')
}

let app = document.querySelector('#app')

patch(app,vnode)